import Taro from '@tarojs/taro'

const AUTH_KEY = 'token'
export const setToken = (token) => {
  return Taro.setStorageSync(AUTH_KEY, token)
}

export const getToken = () => {
  return Taro.getStorageSync(AUTH_KEY)
}

export const resetToken = () => {
  try {
    return Taro.removeStorageSync(AUTH_KEY)
  } catch (err) {
    return new Error(err)
  }
}

